Skip to content

Conversation

@shainaraskas
Copy link
Collaborator

@shainaraskas shainaraskas commented Nov 13, 2025

Ports over and lightly edits the content from elastic/elasticsearch#137688

also interlinks from every place where we introduce opportunities to BYO cert for transport mTLS.

core change: deploy-manage/security/external-ca-transport.md (placed so it applies to both ECK and fully self-managed deployments)

@shainaraskas shainaraskas marked this pull request as ready for review November 13, 2025 17:57
@shainaraskas shainaraskas requested a review from a team as a code owner November 13, 2025 17:57
Copy link
Contributor

@DaveCTurner DaveCTurner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm in transit at the moment and the wifi here is awful so this isn't a complete review, but overall looks good. I left some comments but will follow with more tomorrow.

Copy link
Contributor

@wajihaparvez wajihaparvez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Suggested some minor edits

Copy link
Contributor

@DaveCTurner DaveCTurner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry a couple of the recent edits need adjusting

Copy link
Contributor

@eedugon eedugon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some comments. Looks like a great addition, but we still need to clarify certain things IMO.


Obtain your transport certificates from a certificate authority that only issues certificates to {{es}} nodes permitted to connect to your cluster. Do not use a public certificate authority or an organization-wide private certificate authority, because these issue certificates to entities beyond your authorized cluster nodes. Use a dedicated private certificate authority for each {{es}} cluster.

Certificates used for mTLS must either have no Extended Key Usage extension, or include both `clientAuth` and `serverAuth` values in the extension. Public certificate authorities typically omit the `clientAuth` value in the Extended Key Usage extension, making them unsuitable for mTLS.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Certificates used for mTLS must either have no Extended Key Usage extension, or include both `clientAuth` and `serverAuth` values in the extension. Public certificate authorities typically omit the `clientAuth` value in the Extended Key Usage extension, making them unsuitable for mTLS.
Certificates used for transport mTLS must either have no Extended Key Usage extension, or include both `clientAuth` and `serverAuth` values in the extension, because the same certificate is used by the node when acting as client and server. Public certificate authorities typically omit the `clientAuth` value in the Extended Key Usage extension, making them unsuitable for {{es}} transport mTLS.

A public certificate without clientAuth is perfectly valid for mTLS in general, but not for ES transport mTLS.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I disagree, it depends whether you read "mTLS" as "everything about setting up a mutually-authenticated TLS connection" or "client-certificate authentication". The general practice seems to be the latter, and that's how we're using it here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this clarification is helpful just because these are transport mtls requirements specifically (and our requirements for http certs are different)

Copy link
Contributor

@eedugon eedugon Nov 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"client-certificate authentication"... and that's how we're using it here.

with client-certificate authentication, in the majority of (common) cases of client-server communications, the client uses a certificate and the server uses a different certificate, hence, typically, the server certificate does not require clientAuth extension, as it's only for server-acting purposes.

The case of Elasticsearch transport is special, because Elasticsearch acts as a client and a server at the same time, using its certificate, hence the cert needs both values.

That's why I didn't want to write a generic sentence causing the impression that in general certificates for mTLS require both extensions, as that could potentially cause a reader to think, that, for example, for an hypothetical use case of mTLS for HTTP, they need a server cert with both values, which would be an incorrect assumption.

But I could be completely wrong, sorry in such case.

It's true that for server-to-server communications and mTLS, the standard would be your point of view @DaveCTurner, I didn't have that in mind earlier.


### Transport certificates vs. HTTP certificates

Transport certificates have different security requirements than [HTTP certificates](/deploy-manage/security/secure-cluster-communications.md#encrypt-http-communication). HTTP connections don't typically use mTLS because HTTP has its own authentication mechanisms. Because of this, HTTP certificates usually don't need to include the `clientAuth` value in their Extended Key Usage extension. HTTP certificates can come from public or organization-wide certificate authorities, while transport certificates should use a cluster-specific private CA. In most cases, you should not use the same certificate for both HTTP and transport connections.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to rephrase this somehow, because server certs without clientAuth extension are perfectly valid for mTLS on HTTP servers.

The transport specific thing is that when it comes to transport layer Elasticsearch node is a client and a server at the same time, and that's why the clientAuth + serverAuth is needed in the transport cert.

But in general for mTLS on HTTP (where clients and servers are different entities), the clients and servers use different certificates, and a server cert without clientAuth would actually be expected. This relation feels incorrect:

HTTP connections don't typically use mTLS because HTTP has its own authentication mechanisms. Because of this, HTTP certificates usually don't need to include the clientAuth value in their Extended Key Usage extension.

First clause is perfectly ok and true, but it's not related with the second, which is also correct per-se.
We should clarify first my suggestion in the ES PR before updating this. In the meantime this is the suggested sentence (which should be improved):

The security requirements for transport certificates (as defined by the xpack.security.transport.ssl.* settings) are significantly different from the security requirements for HTTP certificates (as defined by the xpack.security.http.ssl.* settings). For HTTP server certificates, it often makes sense to obtain the nodes' HTTP certificates from a public certificate authority, or from an organization-wide private certificate authority. HTTP server certificates don't require the clientAuth Extended Key Usage extension because they are used solely for server authentication, regardless of whether mTLS is enabled. In practice, HTTP connections do not generally use mTLS, since HTTP has its own authentication mechanisms. It is almost always a mistake to use the same certificate for both HTTP and transport connections.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In most cases, you should not use the same certificate for both HTTP and transport connections.

Not only the certificates, I think we also want users to use different CAs for HTTP and transport, so:

  • Dedicated (purely private) CA for transport, creating certs for nodes transport layer.
  • Whatever the user prefers based on their security requirements for HTTP, even a purely private CA too, but a different one that the transport CA.

thoughts?

I think this section (which is super important IMO) needs a few paragraphs, bullets and pointers.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above I would rather not split hairs about whether mTLS refers just to the client-certificate authentication or the whole connection process.

Likewise, you're right that there are many other concerns (mostly addressed elsewhere in this text) about how to obtain these certificates. Yet, a very common mistake is for users to use the same certificate for both uses, and it is vitally important to have a sentence calling out this case.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a very common mistake is for users to use the same certificate for both uses, and it is vitally important to have a sentence calling out this case.

yes, totally agree!

I realize now that all the misunderstanding and what I was considering "not accurate" in the writing it's because I have in my mind a standard client to server communication model, and I believe you are thinking of a server - server communication flow.

With that a server-to-server communication model in mind (typical in clusters and used in Elasticsearch transport), then the statement about mTLS requiring both clientAuth and serverAuth extension in the server certificate becomes accurate and valid. Sorry I wasn't finding it accurate because I was thinking in a client-to-server basic flow.

Anyway I think latest changes by @shainaraskas already improve this.


## mTLS transport certificate requirements for external CAs

Obtain your transport certificates from a certificate authority that only issues certificates to {{es}} nodes permitted to connect to your cluster. Do not use a public certificate authority or an organization-wide private certificate authority, because these issue certificates to entities beyond your authorized cluster nodes. Use a dedicated private certificate authority for each {{es}} cluster.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This first sentence should probably be considered or used for comparison in the section "Transport vs HTTP".

We probably want to explain that this is not that relevant for HTTP, and for HTTP, for operational purposes (and because we have extra authentication and authorization mechanisms), it's common to not use dedicated CAs per cluster, and even public / organizational CAs that are automatically trusted by the clients.

Of course this will depend on the use case, as in certain use cases it might have sense to have the HTTP layer also super-protected at TLS level.

We should end up with the recommendation that as minimum, if they use private CAs, they should create a private CA to generate transport certs, and another private CA to generate HTTP certs.

This relates with the comment in the "transport vs HTTP" section.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what concrete change you're suggesting here. The title of this page is Using an external certificate authority to secure node-to-node connections so the context is already set that this is about transport connections, not HTTP. Then we follow up with a section about how this stuff all differs from HTTP that I think covers your points here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry if I wasn't clear enough @DaveCTurner , I wasn't suggesting a change there, just highlighting that the style and content of that first paragraph could be used in the section where we compare HTTP and transport.

@shainaraskas
Copy link
Collaborator Author

@eedugon @DaveCTurner thanks to both of you for your attention to this PR.

Committed a couple of small changes to take into account Edu's feedback without hopefully making things too fuzzy from your POV, David: df3fe49 (#3932)

please let me know if I struck the right balance here. thanks both for your patience.

Transport certificates have different security requirements than [HTTP certificates](/deploy-manage/security/secure-cluster-communications.md#encrypt-http-communication). HTTP connections don't typically use mTLS because HTTP has its own authentication mechanisms. Because of this, HTTP certificates usually don't need to include the `clientAuth` value in their Extended Key Usage extension. HTTP certificates can come from public or organization-wide certificate authorities, while transport certificates should use a cluster-specific private CA. In most cases, you should not use the same certificate for both HTTP and transport connections.
Transport certificates have different security requirements than [HTTP certificates](/deploy-manage/security/secure-cluster-communications.md#encrypt-http-communication). HTTP server certificates don't require the `clientAuth` Extended Key Usage extension because they are used solely for server authentication, regardless of whether mTLS is enabled. In practice, HTTP connections don't typically use mTLS because HTTP has its own authentication mechanisms.

HTTP certificates can come from public or organization-wide certificate authorities, while transport certificates should use a cluster-specific private CA. In most cases, you should not use the same CA or certificate for both HTTP and transport connections.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note "CA or certificate" here

Copy link
Contributor

@eedugon eedugon Nov 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it a lot, thanks!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants